# coding = utf-8
from django.urls import path
from rest_framework.routers import DefaultRouter
from .views import JobViewSet, AccountTitleViewSet, EmployeeViewSet, CustomerViewSet, BankViewSet, CasePersonViewSet, \
    CaseLawyerViewSet, EmployeeListAPIView, CaseCategoryAPIView, SaleOrderViewSet, ReceiptViewSet, CustomerListAPIView, \
    SaleOrderListAPIView, ExpenseViewSet, ProfitRuleViewSet, OtherIncomeViewSet, PaymentOrderViewSet, JournalViewSet, \
    PaymentDetailViewSet, InitAccountViewSet, PayOrderViewSet, BorrowLendViewSet, FundBillViewSet, RepaymentBillViewSet, \
    AccountCodeViewSet, AccountCodeListAPIView, ProfitStats, BusinessFeeViewSet, Hanzi2Pinyin

router = DefaultRouter()
router.register(r'job', JobViewSet, basename="job")
router.register(r'code', AccountCodeViewSet, basename="code")
router.register(r'account', AccountTitleViewSet, basename="account")
router.register(r'employee', EmployeeViewSet, basename="employee")
router.register(r'customer', CustomerViewSet, basename="customer")
router.register(r'case_person', CasePersonViewSet, basename="case-person")
router.register(r'case_lawyer', CaseLawyerViewSet, basename="case-lawyer")
router.register(r'sale', SaleOrderViewSet, basename="sale")
router.register(r'receipt', ReceiptViewSet, basename="receipt")
router.register(r'bank', BankViewSet, basename="bank")
router.register(r'expense', ExpenseViewSet, basename="expense")
router.register(r'rule', ProfitRuleViewSet, basename="rule")
router.register(r'income', OtherIncomeViewSet, basename="income")
router.register(r'pay', PayOrderViewSet, basename="pay")
router.register(r'payment', PaymentOrderViewSet, basename="payment")
router.register(r'payment_detail', PaymentDetailViewSet, basename="payment-detail")
router.register(r'journal', JournalViewSet, basename="journal")
router.register(r'borrow_lend', BorrowLendViewSet, basename="borrow-lend")
router.register(r'init', InitAccountViewSet, basename="init-account")
router.register(r'fund', FundBillViewSet, basename="fund-bill")
router.register(r'repayment', RepaymentBillViewSet, basename="fund-repayment-bill")
router.register(r'business_fee', BusinessFeeViewSet, basename="business-fee")

urlpatterns = [
    # path('login/', JSONWebTokenAPIView.as_view(), name="api-user-login"),
    path('employee_list/', EmployeeListAPIView.as_view(), name="api-employee-list"),
    path('customer_list/', CustomerListAPIView.as_view(), name="api-customer-list"),
    path('case_category/', CaseCategoryAPIView.as_view(), name="api-case-category"),
    path('sale_list/', SaleOrderListAPIView.as_view(), name="api-sale-list"),
    path('code_list/', AccountCodeListAPIView.as_view(), name="api-code-list"),
    path('profit_stats/', ProfitStats.as_view(), name="api-profit-stats"),
    path('hz2py/', Hanzi2Pinyin.as_view(), name="api-hz-py"),
]

urlpatterns += router.urls
